﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NCHQMES
{
    /// <summary>
    /// 设备状态改变接口
    /// </summary>
    [Serializable]
    public class SCADA_StatusChange
    {
        /// <summary>
        /// 发送数据
        /// </summary>
        [Serializable]
        public class Write : CommonClass.Common_WriteHead
        {
            public Main MAIN = new Main();
        }

        /// <summary>
        /// 接收数据
        /// </summary>
        [Serializable]
        public class Read : CommonClass.Common_ReadHead
        {
            public Main MAIN = new Main();
        }

        /// <summary>
        /// MAIN结构
        /// </summary>
        [Serializable]
        public class Main : CommonClass.Common_Main
        {
            public Main()
            {
                Status = "";
                EQSN = "";
                OperatorName = "";
                HostName = "";
                IP = "";
            }

            /// <summary>
            /// 设备转态
            /// </summary>
            public string Status = "";
        }

        /// <summary>
        /// 设备状态
        /// </summary>
        public enum Status
        {
            /// <summary>
            /// 运行，需要主动送
            /// </summary>
            Runing,

            /// <summary>
            /// 报警，不需要主动送，设备送报警接口时系统自动更改为此状态
            /// </summary>
            Warning,

            /// <summary>
            /// 维修，不需要主动送，人工点消除报警，设备送报警结束接口时系统自动更改为此状态
            /// </summary>
            Repair,

            /// <summary>
            /// 停机，需要主动送
            /// </summary>
            Stop,

            /// <summary>
            /// 异常停机，不需要主动送，心跳接口无反馈后系统自动触发更改为此状态
            /// </summary>
            AbnormalStop,

            /// <summary>
            /// 待料，不需要主动送，目前定义为除了正在测试的时候都算待料，系统没有此状态显示，后续报表通过总正常时间-运行时间汇总统计待料时间
            /// </summary>
            Wait,

            /// <summary>
            /// 点检，不需要主动送，暂定与TPM系统联动
            /// </summary>
            Check,

            /// <summary>
            /// 保养，不需要主动送，暂定与TPM系统联动
            /// </summary>
            Maintenance
        }
    }
}